import React, { useCallback, useMemo } from "react";
import "./App.css";
import { useState } from "react";
import Son4 from "./Son4";

let MemoSon = React.memo(Son4);

function App() {
  let [num, setNum] = useState(0);

  let obj = useMemo(() => {
    return {
      a: 1,
    };
  }, []);

  let f1 = useCallback(function f1() {
    console.log("123456");
  }, []);

  return (
    <div>
      <div>{num}</div>
      <button
        onClick={() => {
          setNum(num + 1);
        }}
      >
        增加
      </button>
      <MemoSon obj={obj} f1={f1}></MemoSon>
    </div>
  );
}
export default App;
